package com.hangzhou.welbeing.welbeinginstrument.activity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.config.RBConstants;
import com.hangzhou.welbeing.welbeinginstrument.utils.Utils;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 时间 2017 年 09 月 27.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.activity
 * 工程名 welbeing_pregnant
 * @desc 为你定制详情页面
 */
public class ForYourCustomArtclePagerActivity extends Activity {
    private static final String TAG = "ForYourCustomArtclePagerActivity";
    @Bind(R.id.activity_for_your_custom_artcle_pager_iv_return)
    ImageView activityForYourCustomArtclePagerIvReturn;
    @Bind(R.id.activity_for_your_custom_artcle_pager_tv_titiles)
    TextView activityForYourCustomArtclePagerTvTitiles;
    @Bind(R.id.activity_for_your_custom_artcle_pager_iv_shared)
    ImageView activityForYourCustomArtclePagerIvShared;
    @Bind(R.id.activity_for_your_custom_artcle_pager_ProgressBar)
    ProgressBar activityForYourCustomArtclePagerProgressBar;
    @Bind(R.id.activity_for_your_custom_artcle_pager_wb_content)
    WebView activityForYourCustomArtclePagerWbContent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_for_your_custom_artcle_pager);
        ButterKnife.bind(this);

        Utils.setStatusBar(this,false,false);
        Utils.setStatusTextColor(true,this);

        String pager_id =  getIntent().getStringExtra("pager_id");
        String art_name =  getIntent().getStringExtra("art_name");
        activityForYourCustomArtclePagerTvTitiles.setText(art_name);
        activityForYourCustomArtclePagerWbContent.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                super.onPageStarted(view, url, favicon);}

            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                activityForYourCustomArtclePagerProgressBar.setVisibility(View.GONE);
            }
        });  //http://oop.welbeing.cn/admin.php/Read/cream?art_id=1
        activityForYourCustomArtclePagerWbContent.loadUrl(RBConstants.SERVER_URL+RBConstants.PREGNANT_MOTHER_FOR_YOUR_CUSTOM_DETAILS_PAGE+pager_id);
        Log.e(TAG,"parseNetworkResponse========"+RBConstants.SERVER_URL+RBConstants.PREGNANT_MOTHER_FOR_YOUR_CUSTOM_DETAILS_PAGE+pager_id);
    }

    @OnClick(R.id.activity_for_your_custom_artcle_pager_iv_return)
    public void onViewClicked() {
        finish();
    }
}
